home *** CD-ROM | disk | FTP | other *** search
/ Aminet 44 / Aminet 44 (2001)(GTI - Schatztruhe)[!][Aug 2001].iso / Aminet / game / patch / WHDIGamesA-B.lzh / Brainball.lha / Brainball / Install < prev    next >
Text File  |  2001-02-10  |  2KB  |  126 lines

  1. ;****************************
  2.  
  3. (set #sub-dir "bdat")        ;sub directory containing data files
  4. (set #readme-file "Readme")    ;name of readme file
  5. (set #cleanup "")        ;files to delete after install
  6. (set #odname "Brainball")        ;original diskname without :
  7.  
  8. ;****************************
  9.  
  10. ;----------------------------
  11. ; Checks if given program is reachable via the path
  12. ; if not abort install
  13. ; IN:  #program - to check
  14. ; OUT: -
  15.  
  16. (procedure P_chkrun
  17.   (if
  18.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  19.     ("")
  20.     (abort ("You must install \"%s\" first !\nIt must be accessible via the path.\nYou can find it in the whdload package." #program))
  21.   )
  22. )
  23.  
  24. (set #program "WHDLoad")
  25. (P_chkrun)
  26.  
  27. ;****************************
  28.  
  29. (if
  30.   (exists #readme-file)
  31.   (if 
  32.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  33.     ("")
  34.     (run ("SYS:Utilities/More %s" #readme-file))
  35.   )
  36. )
  37.  
  38. (set @default-dest
  39.   (askdir
  40.     (prompt ("Where should \"%s\" installed ?\nA drawer \"%s\" will automatically created." @app-name @app-name))
  41.     (help @askdir-help)
  42.     (default @default-dest)
  43.     (disk)
  44.   )
  45. )
  46. (set #dest (tackon @default-dest @app-name))
  47. (if
  48.   (exists #dest)
  49.   (
  50.     (set #choice
  51.       (askbool
  52.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted ?" #dest))
  53.         (default 1)
  54.         (choices "Delete" "Skip")
  55.         (help @askbool-help)
  56.       )
  57.     )
  58.     (if
  59.       (= #choice 1)
  60.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  61.     )
  62.   )
  63. )
  64. (makedir #dest
  65.   (help @makedir-help)
  66.   (infos)
  67. )
  68.  
  69. ;----------------------------
  70.  
  71. (copyfiles
  72.   (help @copyfiles-help)
  73.   (source ("%s.slave" @app-name))
  74.   (dest #dest)
  75. )
  76. (copyfiles
  77.   (help @copyfiles-help)
  78.   (source ("%s.inf" @app-name ))
  79.   (newname ("%s.info" @app-name ))
  80.   (dest #dest)
  81. )
  82. (if
  83.   (exists #readme-file)
  84.   (
  85.     (copyfiles
  86.       (help @copyfiles-help)
  87.       (source #readme-file)
  88.       (dest #dest)
  89.     )
  90.     (copyfiles
  91.       (help @copyfiles-help)
  92.       (source ("%s.info" #readme-file))
  93.       (dest #dest)
  94.     )
  95.   )
  96. )
  97. (if
  98.   (= #sub-dir "")
  99.   ("")
  100.   (
  101.     (set #dest (tackon #dest #sub-dir))
  102.     (makedir #dest
  103.       (help @makedir-help)
  104.     )
  105.   )
  106. )
  107.  
  108. ;----------------------------
  109.  
  110. (working ("Please insert your %s disk in any drive." @app-name))
  111. (
  112.   (copyfiles
  113.     (help @copyfiles-help)
  114.     (source ("%s:" #odname))
  115.     (dest #dest)
  116.     (pattern "(BRAINBALL|LEVEL??)")
  117.   )
  118. )
  119.  
  120. ;----------------------------
  121.  
  122. (run ("Delete %s ALL QUIET FORCE" #cleanup))
  123.  
  124. (exit)
  125.  
  126.